package com.atguigu.yygh.hosp;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.data.mongodb.core.mapping.Field;

import java.util.Date;

@AllArgsConstructor
@NoArgsConstructor
@Data
@Document("User") // 集合名称
public class User {
    
    @Id//实体类中的id属性和mg中文档的_id(主键)映射
    private String id;


    private String name;//默认类中的属性名和文档中的字段名一致

    @Field(value = "mage")
    private Integer age;

    private Date createDate;
}